package com.itheima.service;

import com.itheima.dao.RoleMapper;
import com.itheima.pojo.Role;
import com.itheima.util.MybatisUtils;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class RoleService {
    public List<Role> getRoleList() {
        SqlSession sqlSession = MybatisUtils.getSqlSession();
        RoleMapper mapper = sqlSession.getMapper(RoleMapper.class);
        List<Role> roleList = mapper.getRoleList();
        sqlSession.close();
        return roleList;
    }
}
